-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1783 #1784
Conversation
@jeff-zucker If you'd like to pull this branch and see if it fulfills your needs, let me know. I can fix issues as they appear or don't resolve properly, but this will serve as the starting point. |
The code looks right. I'll download and test tomorrow. Thanks much! |
@zg009 Thanks. I think this is correct.
|
@bourgeoa I addressed your first and second point. I need more clarity about what I need to check in the test suite. |
Your code works but I think (to be discussed) it does not respect the actual code logic (I did not create it nor help maintain this part) I thin k your function should be implemented here
To avoid |
@bourgeoa Are you saying in the static from method, move the logic from current changes into the from method and set the 'host' variable in that way? |
Yes but I am not sure of me at all |
I was thinking that from was returning all data needed from input |
The only places I see AccountManager and AccountTemplate interacting is here node-solid-server/lib/models/account-manager.js Lines 390 to 402 in 07ee53c
If you trace AccountTemplate.for(), it is the only code which uses AccountTemplate.templateSubstitutionsFor(). I could modify the AccountTemplate.for method to take hostname from AccountManager object from AccountManager.createAccountFor. EDIT: Actually, looking at the code further, the same end goal is reached. I do not have strong feelings about where to move the host server checking logic. It seems logical to pass hostname to AccountTemplate.for and change webId path based upon that. |
To improve cleaning the logic this should be moved : node-solid-server/lib/create-app.js Line 56 in 18b7cb3
inside function initWebId
And may be passed via
|
I wonder if there is a situation where there is any difference between
What do you think ? May be with external WebId ? |
I marked it as draft because it is not working.
The podUri is not stored in userAccount. May be look at |
Yeah, I figured this wouldn't be so simple. I'll have some time to take a deeper dive later this week or early June, I am busy with my current work right now. |
It is the first time I go in the logic of the account manager of NSS code. |
Thanks much for looking in to it. I do not see this as in any way high priority and can deal with it in other ways, so there is no rush on my account. And I can't think that's priority for others either. |
@jeff-zucker I agree it is not high priority. @zg009 I think I resolved it. Thanks again for your help.
|
You will need to clarify what predefined constants I should be using for these tests. |
This is not in the tests, but to improve the code to use node-solid-server/lib/models/account-manager.js Lines 50 to 51 in 1034123
in place of |
@bourgeoa I edited your function a little bit because the webID document was including port. If this is unintended behavior I can revert. I also added one test case. If you want to see other test cases, let me know. |
Yes, this is important, users ought to be able to change the port of the server without having to recreate an account. |
replaced wirh url.origin and updated tests that should have failed on relative webId and did not. |
@bourgeoa Looks better to me, I had the wrong idea about which tests should pass |
@bourgeoa Is this good to merge? |
This is the thread for addressing #1783
Current has some work to register hostname on server creation and apply it to AccountTemplate class as a static variable
Ran some tests with localhost webId resolution.
Integration tests probably need more granularity, also strategy to handle multiuser mapping due to prefix path rather than postfix.